<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // extends
        function Animal(name,age,gender){
            this.name = name;
            this.age = age;
            this.gender = gender;
        }
        Animal.prototype.eat = function(){
            console.log("吃");
        }
        /* extends */
        class Dog extends Animal{}

        let d1 = new Dog("a黄",18,"男");
        d1.eat();
        console.log(d1);
    </script>
</body>
</html>